import numpy as np
import pandas as pd
from pandas import Series,DataFrame
np.random.seed(12345)
data = DataFrame(np.random.randn(1000, 4))
print data
print data.describe()

col = data[3]
print col
print col[np.abs(col) > 3]
print data[(np.abs(data) > 3).any(1)]

print "------------------1--------------------"
df = DataFrame(np.arange(5*4).reshape(5,4))
print df
sample = np.random.permutation(5)
print sample
print df.take(sample)

print "------------------2--------------------"
df = DataFrame({'key':['b', 'b', 'a', 'c', 'a', 'b'],
                'data1':range(6)})
print df
print df.get_dummies(df['key'])